//2009/08/22 01:58:40
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ChangingString
{
public:
    int distance(string A, string B, int K)
    {
        vector<int> dis;
        for (int i=0; i<A.size(); i++)
        {
            dis.push_back(abs(A[i]-B[i]));
        }
        sort(dis.rbegin(), dis.rend());
        int sum = 0;
        for (int i=0; i<K;i++)
            if (dis[i]==0)
                dis[i]=1;
            else
                dis[i] = 0;
        for (int i=0; i<dis.size(); i++)
            sum += dis[i];
        return sum;
    }
};
